import java.util.Random;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {

    }
    public void work4() {
        int random = new Random().nextInt(1000);
        int caice = 0;
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            caice = scanner.nextInt();
            if (caice > random) {
                System.out.println("大了");
            } else if (caice < random) {
                System.out.println("小了");
            }
            if (caice == random) {
                System.out.println("随机数为" + random);
                System.exit(0);//退出循环
            }
        }
        System.out.println("结束");
    }
}